package com.ruoyi.voucher.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.voucher.domain.VoucherAttachment;
import com.ruoyi.voucher.domain.VoucherDetail;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @BelongsProject: RuoYi-Cloud-master
 * @BelongsPackage: com.ruoyi.voucher.dto
 * @Author: songYuHang
 * @CreateTime: 2025-02-26  19:06
 * @Description: TODO
 * @Version: 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class VoucherDto {

    //凭证表字段--------------------------------
    private Long voucherId;

    /** 凭证字号 */
    @NotBlank(message = "凭证字号不能为空")
    private String voucherNo;

    /** 开票日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "开票日期不能为空")
    private Date voucherDate;

    /** 账期 */
    @NotBlank(message = "账期不能为空")
    private String accountPeriod;

    /** 附单据数量 */
    private Long attachmentCount;

    /** 合计金额 */
    private BigDecimal totalAmount;

    /** 审核时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date auditTime;

    /** 账套ID */
    @NotNull(message = "账套ID不能为空")
    private Long accountId;

    /** 凭证字ID */
    @NotNull(message = "凭证字ID不能为空")
    private Long wordId;

    /** 版本号 */
    private Long version;


    //凭证明细表字段--------------------------------
    //凭证明细列表不为空
    @NotEmpty(message = "凭证明细列表不能为空")
    private List<VoucherDetail> voucherDetailList;

    //凭证附件
    private List<VoucherAttachment> voucherAttachmentList;

}
